<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
    <h4>微信第三方登录时，会出现很短的时间内同时发送两个相同请求的情况，并且code只能用一次，所以会导致错误，需要处理这种情况</h4>
    <script>
        var code="<?php echo $_GET['code'];?>";
        <?php
            $req = empty($_GET['req']) ? 2 : $_GET['req'];
        ?>
        var req=parseInt("<?php echo $req;?>");
        var host="http://serve.airbaba.cn/wechat/o_auth_test/qrconnectCode";
        // var host="http://localhost:806/wechat/o_auth_test/qrconnectCode";
        var url=host+"?code="+code;
        for(var i=0;i<req;i++){
            $.post(url+"&req=1",function(data){
                console.log(data);
            });
        }
    </script>
</body>
</html>
